object MAINDM: TMAINDM
  OldCreateOrder = False
  Left = 944
  Top = 684
  Height = 269
  Width = 336
  object pMainDatabase: TpFIBDatabase
    AutoReconnect = True
    DBName = '172.16.0.220:develop_grad2'
    DBParams.Strings = (
      'user_name=SYSDBA'
      'password=d_str255'
      'lc_ctype=WIN1251'
      'sql_role_name=')
    DefaultTransaction = pMainTransaction
    DefaultUpdateTransaction = pMainTransaction
    SQLDialect = 3
    Timeout = 0
    AfterDisconnect = pMainDatabaseAfterConnect
    DesignDBOptions = []
    CacheSchemaOptions.LocalCacheFile = 'BuhCash'
    CacheSchemaOptions.AutoSaveToFile = True
    CacheSchemaOptions.AutoLoadFromFile = True
    CacheSchemaOptions.ValidateAfterLoad = False
    WaitForRestoreConnect = 0
    AfterConnect = pMainDatabaseAfterConnect
    Left = 28
    Top = 8
  end
  object pMainTransaction: TpFIBTransaction
    DefaultDatabase = pMainDatabase
    TimeoutAction = TARollback
    Left = 28
    Top = 52
  end
  object pMainErrorHandler: TpFibErrorHandler
    OnFIBErrorEvent = pMainErrorHandlerFIBErrorEvent
    Options = [oeException, oeForeignKey, oeLostConnect, oeCheck, oeUniqueViolation]
    Left = 120
    Top = 12
  end
  object ds_UserParams: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    RNAME,'
      '    RNAMEORG,'
      '    RUSER_ID,'
      '    (select t.closedate from t_periodclose t) as closed_period,'
      '    current_date'
      'FROM '
      '    USER_GETNAME '
      '')
    AfterOpen = ds_UserParamsAfterOpen
    Transaction = trTimer
    Database = pMainDatabase
    Left = 28
    Top = 100
    poUseBooleanField = False
    poGetOrderInfo = False
    poEmptyStrToNull = False
    oRefreshAfterPost = False
    object ds_UserParamsRNAME: TFIBStringField
      FieldName = 'RNAME'
      Size = 120
      EmptyStrToNull = False
    end
    object ds_UserParamsRNAMEORG: TFIBStringField
      FieldName = 'RNAMEORG'
      Size = 1000
      EmptyStrToNull = False
    end
    object ds_UserParamsRUSER_ID: TFIBIntegerField
      FieldName = 'RUSER_ID'
    end
    object ds_UserParamsCLOSED_PERIOD: TFIBDateField
      FieldName = 'CLOSED_PERIOD'
      DisplayFormat = 'dd.mm.yyyy'
    end
    object ds_UserParamsCURRENT_DATE: TFIBDateField
      FieldName = 'CURRENT_DATE'
    end
  end
  object dsc_UserParams: TDataSource
    DataSet = ds_UserParams
    Left = 28
    Top = 144
  end
  object KickTimer: TTimer
    Interval = 20000
    OnTimer = KickTimerTimer
    Left = 124
    Top = 64
  end
  object trTimer: TpFIBTransaction
    DefaultDatabase = pMainDatabase
    TimeoutAction = TARollback
    TRParams.Strings = (
      'read'
      'nowait'
      'rec_version'
      'read_committed')
    TPBMode = tpbDefault
    Left = 192
    Top = 64
  end
  object ds_Check: TpFIBDataSet
    SelectSQL.Strings = (
      'select count(1) from abonents a'
      'where a.client_id >= 0')
    AfterOpen = ds_UserParamsAfterOpen
    Transaction = trTimer
    Database = pMainDatabase
    Left = 124
    Top = 116
    poUseBooleanField = False
    poGetOrderInfo = False
    poEmptyStrToNull = False
    oRefreshAfterPost = False
    object ds_CheckCOUNT: TFIBIntegerField
      FieldName = 'COUNT'
    end
  end
  object ds_License: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    l.SERIAL,'
      '    l.BDATE,'
      '    l.EDATE,'
      '    l.MAX_ACCOUNTS,'
      '    l.CHECKSUMM,'
      '    o.NAME as ORGNAME'
      'FROM LICENSES l'
      'JOIN USERORG O ON O.ID = l.ORG_ID')
    Transaction = pMainTransaction
    Database = pMainDatabase
    Left = 124
    Top = 168
    object ds_LicenseSERIAL: TFIBStringField
      FieldName = 'SERIAL'
      Size = 255
      EmptyStrToNull = True
    end
    object ds_LicenseBDATE: TFIBDateField
      FieldName = 'BDATE'
    end
    object ds_LicenseEDATE: TFIBDateField
      FieldName = 'EDATE'
    end
    object ds_LicenseMAX_ACCOUNTS: TFIBIntegerField
      FieldName = 'MAX_ACCOUNTS'
    end
    object ds_LicenseCHECKSUMM: TFIBStringField
      FieldName = 'CHECKSUMM'
      Size = 255
      EmptyStrToNull = True
    end
    object ds_LicenseORGNAME: TFIBStringField
      FieldName = 'ORGNAME'
      Size = 60
      EmptyStrToNull = True
    end
  end
  object CheckLicenseTimer: TTimer
    Interval = 10800000
    OnTimer = CheckLicenseTimerTimer
    Left = 196
    Top = 120
  end
end
